Skip to content

Fix crash that can happen while loading into missions from the menu - #721

Open
hdr88 wants to merge 1 commit into
thepeacockproject:masterfrom
hdr88:master
Open

Fix crash that can happen while loading into missions from the menu#721
hdr88 wants to merge 1 commit into
thepeacockproject:masterfrom
hdr88:master

Conversation

@hdr88

@hdr88 hdr88 commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Scope

This change will fix crash that can happen while loading into missions from the menu. Relevant issue:
#596

Test Plan

After countless hours of trial and error, i narrowed the source of the crash to the lines 4-6 in static/peacock-menu/index.json:
"datavalues": {
"@global.CacheBuster": "0"
},
Removing this, the game no longer seems to crash during loading. Verified by loading into missions over and over (100+ at least). Without this fix, the game crashes something like 1 out of 15 times or so when loading a mission. Maybe i just got unbeliavably lucky though, so i would appreciate others trying this fix.
I also verified that the peacock menu in settings still work, so not sure what this CacheBuster is used for, other than making the game crash.

Checklist

@AnthonyFuller AnthonyFuller left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not exactly what I'd describe as a desirable fix. The "CacheBuster" is exactly that, the game caches JSON files retrieved from the server and the CacheBuster forces it to be re-requested. I don't think this is just a Dev feature, I believe it's partly needed for the general operation of the in-game menu.

I'm not dismissing this finding outright since it makes sense that this is causing a crash when it's destroyed and re-created, but I have definitely experienced a somewhat similar crash on official.

@LukaMegurine6

Copy link
Copy Markdown

Scope

This change will fix crash that can happen while loading into missions from the menu. Relevant issue: #596

Test Plan

After countless hours of trial and error, i narrowed the source of the crash to the lines 4-6 in static/peacock-menu/index.json: "datavalues": { "@global.CacheBuster": "0" }, Removing this, the game no longer seems to crash during loading. Verified by loading into missions over and over (100+ at least). Without this fix, the game crashes something like 1 out of 15 times or so when loading a mission. Maybe i just got unbeliavably lucky though, so i would appreciate others trying this fix. I also verified that the peacock menu in settings still work, so not sure what this CacheBuster is used for, other than making the game crash.

Checklist

I'm going to test that, i'm not 100 % sure too but if it's reduce, it's could be already great tbh

@LukaMegurine6

Copy link
Copy Markdown

The fix works...
I'm happy but very suprised too
Before I couldn't load the bank, Haven and of course FV without crashing at least once, now I can load everything in one session...wow
I restarted the game 10 times, I was able to launch FV each time and the other destinations without any crash
And FV mission to safehouse don't crash too

It's does not result memory crash (ofc) but it's seem to work just fine !

@LukaMegurine6

Copy link
Copy Markdown

EDIT : It's not result all crashes, probably someone else need to test the fix.

@hdr88

hdr88 commented Aug 17, 2026

Copy link
Copy Markdown
Contributor Author

This is not exactly what I'd describe as a desirable fix. The "CacheBuster" is exactly that, the game caches JSON files retrieved from the server and the CacheBuster forces it to be re-requested. I don't think this is just a Dev feature, I believe it's partly needed for the general operation of the in-game menu.

I'm not dismissing this finding outright since it makes sense that this is causing a crash when it's destroyed and re-created, but I have definitely experienced a somewhat similar crash on official.

Even without the changes i did, if i change some peacock setting in the menu, i do not see the game sending a request for a new JSON file at all. What it does, it sends a SubmitSemEmail request which is used to getAllFlags. Also i can see that in the response of the SubmitSemEmail request, there is a CacheBuster field and its value is a date, but it is not clear to me whether the game uses this for anything.
I validated, even with my changes, the peacock menu behavior is exactly the same like i described above.

@LennardF1989

LennardF1989 commented Aug 17, 2026

Copy link
Copy Markdown
Member

@hdr88 Could you test this commit? 57e44fd

Branch lennard/cachebuster-fix if you just want to clone and go.

Do not apply it on top of the changes in the PR.

@hdr88

hdr88 commented Aug 18, 2026

Copy link
Copy Markdown
Contributor Author

@hdr88 Could you test this commit? 57e44fd

Branch lennard/cachebuster-fix if you just want to clone and go.

Do not apply it on top of the changes in the PR.

I tested the commit and it works also, loaded into missions many times, game does not crash.
The request URLs for peacock menus do change with this commit compared to master, they no longer have 0 in them. For example, they look like this:
/peacock-menu/options.json@?sv=2018-03-28&ver=h3
instead of this
/peacock-menu/options.json@0?sv=2018-03-28&ver=h3
On master, that 0 comes from assigning value to @global.CacheBuster in static/peacock-menu/index.json, which is not safe to do it seems.
Without explicitly assinging 0 to @global.CacheBuster, it seems like it does have any value, at least it did not have during my testing.

@LennardF1989

Copy link
Copy Markdown
Member

Thank you for confirming, the missing "0" after the @ was intentional. There are ways to get it back, but it doesn't add anything.

My branch would therefor be the preferred fix to the crash issue, since it does not remove the cache buster functionality during development.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants